<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>093-生成元素.html</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		div{
			width: 100px;
			height: 100px;
			background-color: blue;
		}
	</style>
</head>
<body>
	<button id="btn">生成元素</button>
</body>
<script>
	var oBtn = document.getElementById('btn');
	oBtn.onclick = function(){
		var oDiv = document.createElement("div");
		console.log(oDiv);
		document.body.appendChild(oDiv);
	}
</script>
</html>